<template>
	<div class="wrapper">
		<div class="top">
			<h1>logo</h1>
			<br/><br/><br/>
			欢迎 {{login_user.realname}} 登录系统
			<a href="#" @click="doLogout()">退出系统</a>
		</div>
		<div class="content">
		    <div class="left">
			<router-link to="/user/query">查询用户</router-link>
		    </div>
			<div class="right">
			<router-view></router-view>
			</div>
		</div>
		<
	</div>
</template>

<script>
	export default{
		name:'Index',
		data(){
			return{
				login_user:{},
				
			}
		},
		mounted(){
			this.login_user=JSON.parse(localStorage.getItem('login_user'));
		},
		methods:{
			doLogout(){
				// let url='/LoginController';
				let url = '/logout'
				let param='act=logout';
				this.$axios.post(url,param)
				.then((resp)=>{
					localStorage.removeItem('login_user');
					this.$router.push('/Login');
				})
				.catch((err)=>{
					console.log("err=",err);
				})
			}
		}
	}
</script>

<style scoped="scoped">
	.wrapper{
			width: 100%;
			height: 100%;
			display: flex;
			flex-direction: column;
		}
		.wrapper .top{
			flex: 0 0 120px;
			background-color: aliceblue;
		}
		.wrapper .content{
			display: flex;
			flex-direction: row;
		}
		.wrapper .content .left{
			flex: 0 0 150px;
			height: 450px;
			background-color: antiquewhite;
		}
		.wrapper .content .right{
			width: 100%;
			background-color: beige;
		}
</style>
